import React, { useState } from 'react'
import { InfiniteScroll } from 'antd-mobile'
import axios from 'axios'

function AppTot() {
    const [dataList,setDataList]=useState([])
    const [pag,setPag]=useState(1)
    const fiyrg=async()=>{
        const res=await axios.get('/api/room/list')
        console.log(res)
        const newData=res.data.data.list
        setDataList([...dataList,...newData])
         setPag(pag+1)
    }
  return (
    <div>
      <div>
         {dataList &&dataList.map((item,index)=>
            <dl>
                <dt><img src={item.url}/></dt>
                <dd>
                    <p>{item.name}</p>
                    <p>{item.title}</p>
                </dd>
            </dl>
         )}
      </div>
       <InfiniteScroll loadMore={fiyrg} hasMore={true} />
    </div>
  )
}

export default AppTot
